#
#	@(#)Makefile
#		for GNU make
#
#	T-Kernel based sample program
#	Copyright (C) 2002-2003 by Personal Media Corporation
#
#	how to make
#	- make
#		make official version for release
#	- make mode=debug
#		create for debug
#	- make clean
#		delete all files created by make
#

# source dependency file (automatically created)
DEPS = Dependencies
DEPENDENCIES_OUTPUT := $(DEPS)

# standard rule
include ../../etc/makerules

# ----------------------------------------------------------------------------

# target to be created
TARGET = tkgles

# search path for source files
S = ../src
VPATH = $S

# source file
SRC = main.c gl.c Context.c Matrix.c

OBJ = $(addsuffix .o, $(basename $(SRC)))

# option
CFLAGS += $(CFLAGS_WARNING)

# ----------------------------------------------------------------------------

.PHONY: all install clean

ALL = $(TARGET) $(TARGET:%=%.map)

all: $(ALL)

$(TARGET): $(OBJ)
	$(LINK.o) $(LDOBJS) $^ $(LOADLIBES) $(LDLIBS) $(OUTPUT_OPTION)

clean:
	$(RM) $(OBJ) $(ALL) $(DEPS)

install: $(addprefix $(EXE_INSTALLDIR)/, $(ALL))

$(TARGET:%=$(EXE_INSTALLDIR)/%): $(EXE_INSTALLDIR)/%: %
	$(EXE_INSTALL_STRIP)


# dependency of source files
ifdef DEPENDENCIES_OUTPUT
  $(DEPS): ; touch $(DEPS)
else
  $(DEPS): $(SRC) ; $(MAKEDEPS) $@ $?
endif
include $(DEPS)
